home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.3 / Video Toaster v4.3.iso / 3.1 / toasterall / arexx_examples / tpaint / embossborder.rexx < prev    next >
OS/2 REXX Batch file  |  1992-01-29  |  1KB  |  57 lines

  1. /* EmbossBorder.rexx  Make 3D style frame in ToasterPaint  */
  2. /* By Arnie Cachelin © 1992 NewTek Inc */
  3. /* 02 Jan 1992 At 10:39:31 */
  4.  
  5. /*
  6.   This program will draw a raised, 3D-look border on the ToasterPaint canvas
  7. using the lighten and darken modes.  Specify the position of the upper left
  8. corner, the outer width and height, and the border thickness.
  9.  */
  10.  
  11. arg x y Width Height Thick
  12.  
  13. Address 'DigiPaint'
  14.  
  15. if pos('DigiPaint',show(ports))=0 then do
  16.   say "Can't find ToasterPaint!"
  17.   exit
  18.   end
  19.  
  20.  
  21. if Arg()=0 then do
  22.   say "Usage: rx EmbossBorder x y width height thickness"
  23.   exit
  24. end
  25. if x="" then x=0
  26. if y="" then y=0
  27. if Width="" then Width=752
  28. if Height="" then Height=480
  29. if Thick="" then Thick=10
  30.  
  31. call EmbossBorder(x, y, Width, Height, Thick)
  32. exit
  33.  
  34. EmbossBorder: PROCEDURE
  35.   arg x, y, Width, Height, Thick
  36.   'Pmcl'          /* Normal paint mode */
  37.   'Flof'          /* Filled Shapes Mode Off */
  38.   'Dotb'          /* One pixel brush */
  39.   'Bsmo'          /* Smooth Draw Mode */
  40.   do i=0 to thick
  41.     x1=x+i
  42.     y1=y+i
  43.     x2=x+Width-i
  44.     y2=y+Height-i
  45.     'Pmln'         /* Lighten Mode */
  46.     'Pend' x2 y1   /* top */
  47.     'Move' x1 y1
  48.     'Move' x1 y2
  49.     'Penu' x1 y2   /* Left  */
  50.     'Pmdn'         /* Darken Mode */
  51.     'Pend' x2 y1   /* Right */
  52.     'Move' x2 y2
  53.     'Move' x1 y2
  54.     'Penu' x1 y2   /* Bottom  */
  55.   end i
  56.   return 0
  57.